<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title></title>
    <meta name="renderer" content="webkit"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all"/>
    <style>
        .layui-form-item .layui-input-inline {
            width: 150px;
        }
    </style>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-tab layui-tab-brief">
            <ul class="layui-tab-title layui_tab_title">
                <li class=""><a href="{:url('user/backpack',array('uid'=>$uid))}">背包情况</a></li>
                <li class=""><a href="{:url('user/ticket',array('uid'=>$uid))}">发放观赛券</a></li>
                <li class=""><a href="{:url('user/ticket_log',array('uid'=>$uid))}">观赛券发放记录</a></li>
                <li class=""><a href="{:url('user/stat_ticket_log',array('uid'=>$uid))}">观赛券用券记录</a></li>
                <li class=""><a href="{:url('order/user_order',array('uid'=>$uid))}">充值记录</a></li>
                <li class=""><a href="{:url('gift/user_send',array('uid'=>$uid))}">送礼记录</a></li>
                <li class=""><a href="{:url('charge/manual',array('uid'=>$uid))}">人工上分</a></li>
                <li class="layui-this"><a href="javascript:;">登录日志</a></li>
            </ul>
        </div>
        <div class="layui-card-body layui-table-body layui-table-main">
            <table id="demo" lay-filter="demo"></table>
        </div>
    </div>
</div>

<script src="/layuiadmin/layui/layui.js"></script>
<script>
    layui.config({
        base: "/layuiadmin/" //静态资源所在路径
    }).extend({
        index: "lib/index", //主入口模块
    }).use(["table"], function () {
        $ = layui.jquery, table = layui.table;
        table.render(
            {
                elem: '#demo',
                id: '#demo',
                url: '/admin/user/login_log?uid={$uid}',
                page: {
                    curr: 1   //默认从第一页开始搜索
                },
                method: "get",
                //where: $("#sbumitForm").serialize(),
                limit: 20,
                limits: [20, 30, 50],
                text: {
                    none: '暂无相关数据！'//默认无数据
                },
                response: {
                    statusName: 'code', //数据状态的字段名称，默认：code
                    statusCode: 0,//成功的状态码，默认：0
                    msgName: 'msg', //状态信息的字段名称，默认：msg
                    countName: 'count', //数据总数的字段名称，默认：count
                    dataName: 'list', //数据列表的字段名称，默认：data
                },
                cols: [[
                    {field: 'create_time', width: "16%", title: '时间', align: 'center'},
                    {field: '', width: "18%", title: '登录IP', align: 'center', templet: function (item) {
                            if (item.last_ip) {
                                return '<a href="https://www.ipshudi.com/' + item.last_ip + '.htm" target="_blank">' + item.last_ip + '</a>';
                            }

                            return '-';
                        }
                    },
                    {
                        field: 'anchor_name', width: "14%", title: '登录设备', align: 'center', templet: function (item) {
                            switch (item.login_platform) {
                                case 0:
                                    return 'WEB';
                                case 1:
                                    return 'IOS';
                                case 2:
                                    return '安卓';

                            }

                            return '-';
                        }
                    },
                    {field: 'device', title: '设备ID', align: 'center'},
                ]],
                done: function (res, curr, count) {
                    res.list.forEach(function (item, index) {

                    });
                },
            }
        );

    });
</script>
</body>
</html>
